//#define _CRT_SECURE_NO_WARNINGS
//#include <stdio.h>
//long long gcd(long long a, long long b) {
//    long long ret = 0;
//    while (b) {
//        ret = a % b;
//        a = b;
//        b = ret;
//    }
//    return a;
//}
//int main() {
//    long long a = 0;
//    long long b = 0;
//    long long i = 0;
//    scanf("%lld %lld", &a, &b);
//    long long num = gcd(a, b);
//    printf("%lld\n", a * (b / num));
//    return 0;
//}
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include<string.h>
void Print(const char arr[], int start, int over) {
	int j = 0;
	for (j = start; j <= over; j++) {
		printf("%c", arr[j]);
	}
	if (start > 0) {
		printf("%c", ' ');
	}
}
int main() {
	char arr[100] = "I like beijing.";
	//gets(arr);
	int start = 0;
	int over = strlen(arr);
	int i = over;
	while (i >= 0) {
		if (arr[i] == ' ') {
			start = i + 1;
			Print(arr, start, over);
			over = over - (over - i) -1;
			i--;
		}
		else if (i == 0) {
			start = 0;
			while (arr[i++] != ' ') {
				over++;
			}
			Print(arr, start, over);
			break;
		}
		else {
			i--;
		}
	}
	return 0;
}